<!DOCTYPE html>
<html lang="zh">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Site Admin</title>

    <!-- Bootstrap Core CSS -->
    <link href="../components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="../components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
    <!-- DataTables Responsive CSS -->
    <link href="../components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- simply-toast -->
    <link href="../components/simply-toast/css/simply-toast.min.css" rel="stylesheet" type="text/css">

    <!-- jquery-confirm -->
    <link href="../components/jquery-confirm/jquery-confirm.min.css" rel="stylesheet" type="text/css">

    <!-- Ztree -->
    <link href="../components/zTree_v3/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="../index.html">Site后台管理系统</a>
        </div>
        <!-- /.navbar-header -->

        <ul class="nav navbar-top-links navbar-right">
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-messages">
                    <li>
                        <a href="#">
                            <div>
                                <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                            </div>
                            <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                            </div>
                            <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                            </div>
                            <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>Read All Messages</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
                <!-- /.dropdown-messages -->
            </li>
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-tasks">
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>Task 1</strong>
                                    <span class="pull-right text-muted">40% Complete</span>
                                </p>

                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40"
                                         aria-valuemin="0" aria-valuemax="100" style="width: 40%">
                                        <span class="sr-only">40% Complete (success)</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>Task 2</strong>
                                    <span class="pull-right text-muted">20% Complete</span>
                                </p>

                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20"
                                         aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                                        <span class="sr-only">20% Complete</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>Task 3</strong>
                                    <span class="pull-right text-muted">60% Complete</span>
                                </p>

                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
                                         aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                                        <span class="sr-only">60% Complete (warning)</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>Task 4</strong>
                                    <span class="pull-right text-muted">80% Complete</span>
                                </p>

                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80"
                                         aria-valuemin="0" aria-valuemax="100" style="width: 80%">
                                        <span class="sr-only">80% Complete (danger)</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>See All Tasks</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
                <!-- /.dropdown-tasks -->
            </li>
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-alerts">
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-comment fa-fw"></i> New Comment
                                <span class="pull-right text-muted small">4 minutes ago</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                <span class="pull-right text-muted small">12 minutes ago</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-envelope fa-fw"></i> Message Sent
                                <span class="pull-right text-muted small">4 minutes ago</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-tasks fa-fw"></i> New Task
                                <span class="pull-right text-muted small">4 minutes ago</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                <span class="pull-right text-muted small">4 minutes ago</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>See All Alerts</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
                <!-- /.dropdown-alerts -->
            </li>
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
                    </li>
                    <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
                    </li>
                    <li class="divider"></li>
                    <li><a href="../login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                    </li>
                </ul>
                <!-- /.dropdown-user -->
            </li>
            <!-- /.dropdown -->
        </ul>
        <!-- /.navbar-top-links -->

        <div class="navbar-default sidebar" role="navigation">
            <div class="sidebar-nav navbar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="sidebar-search">
                        <div class="input-group custom-search-form">
                            <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                        </div>
                        <!-- /input-group -->
                    </li>
                    <li>
                        <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="flot.html">Flot Charts</a>
                            </li>
                            <li>
                                <a href="morris.html">Morris.js Charts</a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
                    </li>
                    <li>
                        <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="panels-wells.html">Panels and Wells</a>
                            </li>
                            <li>
                                <a href="buttons.html">Buttons</a>
                            </li>
                            <li>
                                <a href="notifications.html">Notifications</a>
                            </li>
                            <li>
                                <a href="typography.html">Typography</a>
                            </li>
                            <li>
                                <a href="icons.html"> Icons</a>
                            </li>
                            <li>
                                <a href="grid.html">Grid</a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-sitemap fa-fw"></i> Multi-Level Dropdown<span
                                class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="#">Second Level Item</a>
                            </li>
                            <li>
                                <a href="#">Second Level Item</a>
                            </li>
                            <li>
                                <a href="#">Third Level <span class="fa arrow"></span></a>
                                <ul class="nav nav-third-level">
                                    <li>
                                        <a href="#">Third Level Item</a>
                                    </li>
                                    <li>
                                        <a href="#">Third Level Item</a>
                                    </li>
                                    <li>
                                        <a href="#">Third Level Item</a>
                                    </li>
                                    <li>
                                        <a href="#">Third Level Item</a>
                                    </li>
                                </ul>
                                <!-- /.nav-third-level -->
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-files-o fa-fw"></i> Sample Pages<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="blank.html">Blank Page</a>
                            </li>
                            <li>
                                <a href="login.html">Login Page</a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-files-o fa-fw"></i> 用户管理<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="/role/role.html">角色列表</a>
                            </li>
                            <li>
                                <a href="/user/user.html">用户列表</a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-files-o fa-fw"></i> 新闻管理<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="/news/news.html">新闻列表</a>
                            </li>
                        </ul>
                        <!-- /.nav-second-level -->
                    </li>
                </ul>
            </div>
            <!-- /.sidebar-collapse -->
        </div>
        <!-- /.navbar-static-side -->
    </nav>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h2 class="page-header">角色列表</h2>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <button type="button" class="btn btn-primary" id="btn-add">新增</i></button>
                        <button type="button" class="btn btn-warning" id="btn-batch-delete">批量删除</i></button>
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="dataTable_wrapper">
                            <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                <tr>
                                    <th><input type="checkbox" id="ckb-select-all"></th>
                                    <th>名称</th>
                                    <th>编码</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                        <!-- /.dataTable_wrapper -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->

    </div>
    <!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">选择权限</h4>
            </div>
            <div class="modal-body" style="height: 368px; heimax-height: 368px; overflow-y: auto;">
                <input type="hidden" id="roleCode" name="roleCode"/>
                <input type="hidden" id="authCodes" name="authCodes"/>
                <a href="" id="checkAllBtn">全选</a>/<a href="" id="cancelAllBtn">全不选</a>
                <a href="" id="collapseAll">全部收起</a>/<a href="" id="expandAll">全部展开</a>
                <table class="list">
                    <tr>
                        <td>
                            <div>
                                <ul id="authsTree" class="ztree"></ul>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="btn-save-auth">保存</button>
            </div>
        </div>
    </div>
</div>

<!-- jQuery -->
<script src="../components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="../components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="../components/metisMenu/dist/metisMenu.min.js"></script>

<!-- DataTables JavaScript -->
<script src="../components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="../components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

<!-- Ztree -->
<script src="../components/zTree_v3/js/jquery.ztree.core-3.5.min.js"></script>
<script src="../components/zTree_v3/js/jquery.ztree.excheck-3.5.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="../dist/js/sb-admin-2.js"></script>

<!-- simply-toast -->
<script src="../components/simply-toast/js/simply-toast.min.js"></script>

<!-- jquery-confirm -->
<script src="../components/jquery-confirm/jquery-confirm.min.js"></script>

<!-- System JavaScript-->
<script src="../js/system.js"></script>

<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
    $(document).ready(function () {
        // dataTable 加载
        var username = "";
        var dtTable = $('#dataTables-example').dataTable({
            "serverSide": true,
//            "bLengthChange":false,
//            "sDom": 'ltipr',
            "language": {
                url: "../components/datatables/zh_CN.json"
            },
//            "scrollX": true,
//            "scrollCollapse": true,
            "iDisplayLength": 10,
            "ajax": {
                url: 'http://localhost:8080/role/datatable',
                "type": "POST",
                "data": function (d) {
                    d.username = username;
                }
            },
            "columns": [
                {"data": "code"},
                {"data": "name"},
                {"data": "code"},
                {"data": "state"},
                {"data": "code"}
            ],
            "order": [[1, "desc"]],
            "columnDefs": [
                {
                    "targets": [0],
                    "data": "code",
                    "bSortable": false,
                    "render": function (data) {
                        return "<input type='checkbox' class='ckb-select-tag' role-code='" + data + "'>";
                    }
                },
                {
                    "targets": [4],
                    "data": "code",
                    "render": function (data) {
                        return "<button type='button' class='btn btn-link btn-auth-setting' role-code='" + data + "'>设置权限</button>" +
                                "<button type='button' class='btn btn-link btn-obj-delete' role-code='" + data + "'>删除</button>";
                    }
                }
            ],
            "initComplete": function (settings, json) {
            }
        }).api();

        // add
        $("#btn-add").click(function () {
            location.href = "role-add.html";
        });

        // double click to edit page
        $("#dataTables-example").find("tbody").on("dblclick", 'tr', function () {
            var obj = dtTable.row($(this)).data();
            location.href = "role-edit.html?code=" + obj.code;
        });

        // setting auth button
        $("#dataTables-example").find("tbody").on("click", '.btn-auth-setting', function () {
            var code = $(this).attr("role-code");
            $("#roleCode").val(code);
            initTree(code);
            $(".modal-title").append(code);
            $("#myModal").modal({backdrop: "static"});
        });

        // delete row
        $("#dataTables-example").find("tbody").on("click", '.btn-obj-delete', function () {
            var code = $(this).attr("role-code");
            var selectedTr = $(this).closest("tr");
            if (selectedTr.length == 0 || !selectedTr.is("tr")) {
                return false;
            }
            confirmCall('该操作将彻底删除记录，确定继续？', function () {
                $.ajax({
                    url: "http://localhost:8080/role/delete/" + code,
                    type: "POST",
                    contentType: "application/json",
                    dataType: "json",
                    success: function () {
                        $.simplyToast("删除成功", "success");
                        dtTable.row(selectedTr).remove().draw();
                    },
                    error: function () {
                        $.simplyToast("操作失败", "error");
                    }
                });
            });

        });

        // check all & unCheck all
        $('#ckb-select-all').change(function () {
            var state = this.checked;
            var $ckbs = $('.ckb-select-tag');
            $ckbs.prop('checked', state);
        });

        // batch delete
        $("#btn-batch-delete").click(function () {
            var codeArray = new Array();
            var trArray;
            $('.ckb-select-tag').each(function () {
                if (this.checked) {
                    var code = $(this).attr("role-code");
                    codeArray.push(code);

                    trArray = new Array();
                    var $selectedTr = $(this).closest("tr");
                    if ($selectedTr.length > 0 && $selectedTr.is("tr")) {
                        trArray.push($selectedTr);
                    }
                }
            });

            if (codeArray.length == 0) {
                $.simplyToast("请至少选中一条记录", "info");
            } else {
                confirmCall('该操作将彻底删除选中的记录，确定继续？', function () {
                    $.ajax({
                        url: _api_server + "/role/batchDelete",
                        data: {
                            "codes": codeArray
                        },
                        type: "POST",
                        success: function () {
                            $.simplyToast("批量删除成功", "success");
                            for (var $tr in trArray) {
                                dtTable.row($tr).remove();
                            }
                            dtTable.draw();
                            $("#ckb-select-all").prop("checked", false);
                        },
                        error: function () {
                            $.simplyToast("操作失败", "error");
                        }
                    });
                });
            }

        });

        // save auth
        $("#btn-save-auth").click(function () {
            //取得选中的结节点
            var zTreeObj = $.fn.zTree.getZTreeObj("authsTree");
            var nodes = zTreeObj.getCheckedNodes(true);
            var arr = [];
            for (var i = 0; i < nodes.length; i++) {
                arr[i] = nodes[i].id;
            }
            var str = arr.join(",");

            $.ajax({
                url: _api_server + "/role/updateoption",
                data: {
                    "roleCode": $("#roleCode").val(),
                    "optionCodes": str
                },
                type: "POST",
                success: function () {
                    $.simplyToast("权限设置成功", "success");
                },
                error: function () {
                    $.simplyToast("操作失败", "error");
                }
            });

        });

        // ztree
        function initTree(roleCode) {
            var setting = {
                check: {
                    enable: true,
                    chkStyle: "checkbox",
                    autoCheckTrigger: true //自动触发父子关联
                },
//                async : {
//                    headers: {'Content-type': 'application/json;charset=UTF-8'},
//                    enable : true, // 设置 zTree是否开启异步加载模式
//                    url : _api_server + "/role/tree", // Ajax 获取数据的 URL 地址
//                    autoParam : [ "id" ] // 异步加载时自动提交父节点属性的参数,假设父节点 node = {id:1, name:"test"}，异步加载时，提交参数 zId=1
//                },

                async: {
                    enable: true,
                    contentType: "application/json",
                    type: "POST",
                    dataType: "json",
                    url: _api_server + "/role/tree",
                    autoParam: ["code"],
                    otherParam: [],
                    dataFilter: null
                },

                data: { // 必须使用data
                    simpleData: {
                        enable: true,
                        idKey: "id", // id编号命名 默认
                        pIdKey: "pId", // 父id编号命名 默认
                        rootPId: 0 // 用于修正根节点父节点数据，即 pIdKey 指定的属性值
                    }
                }
            };

            setting.async.url += "/" + roleCode;
            //初始化树
            $.fn.zTree.init($("#authsTree"), setting);

            //全选
            $("#checkAllBtn").click(function () {
                var zTreeObj = $.fn.zTree.getZTreeObj("authsTree");
                zTreeObj.checkAllNodes(true);
                return false;
            });

            //全取消
            $("#cancelAllBtn").click(function () {
                var zTreeObj = $.fn.zTree.getZTreeObj("authsTree");
                zTreeObj.checkAllNodes(false);
                zTreeObj.checkAllNodes(false);
                return false;
            });

            //全部展开
            $("#expandAll").click(function () {
                var zTreeObj = $.fn.zTree.getZTreeObj("authsTree");
                zTreeObj.expandAll(true);
                return false;
            });

            //全部收起
            $("#collapseAll").click(function () {
                var zTreeObj = $.fn.zTree.getZTreeObj("authsTree");
                zTreeObj.expandAll(false);
                return false;
            });
        }

        // confirm callback
        function confirmCall(msg, callback) {
            $.confirm({
                icon: 'fa fa-warning',
                theme: 'hololight',
                title: '温馨提示',
                content: msg,
                confirmButton: '继续',
                cancelButton: '取消',
                confirmButtonClass: 'btn-info',
                cancelButtonClass: 'btn-danger',
                confirm: callback
            });
        }


    });
</script>

</body>

</html>
